import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/Login.vue'

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    { path: '/', redirect: '/login' },
    { path: '/login', component: Login },
    { path: '/register', component: () => import('@/views/Register') },
    { path: '/register', component: () => import('@/views/Register') },
    {
      path: '/home',
      component: () => import('@/views/Home'),
      children: [
        { path: '/home', redirect: '/home/article' },
        { path: 'article', component: () => import('@/views/Layout/Article') },
        { path: 'collect', component: () => import('@/views/Layout/Collect') },
        { path: 'Like', component: () => import('@/views/Layout/Like') },
        { path: 'User', component: () => import('@/views/Layout/User') },
        { path: 'detail', component: () => import('@/views/Detail') }
      ]
    }
  ]
})

export default router
